package com.glorysoft.lipuxinpda.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.glorysoft.lipuxinpda.R;
import com.glorysoft.lipuxinpda.entity.CheckInfoDetailEntity;
import com.glorysoft.lipuxinpda.entity.LotngInfo;
import com.pda.platform.ui.ui_pdaplatform.view.FreeUI_ClearEditText;

import java.util.List;

public class LotnginfoAdapter extends RecyclerView.Adapter<LotnginfoAdapter.ViewHolder>{
    private List<LotngInfo> lotngIngoList;//不良品分类详情

    public void setmList(List<LotngInfo> mList) {
        this.lotngIngoList = mList;

        notifyDataSetChanged();
    }

    @NonNull
    @Override
    public LotnginfoAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_check_type_detail, parent, false);
        return new LotnginfoAdapter.ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull LotnginfoAdapter.ViewHolder holder, int position) {
        LotngInfo entity = lotngIngoList.get(position);

        holder.tv_lotinfoList.setText(entity.getNGKEY());
        holder.et_reason.setText(entity.getNGVALUE());

    }

    @Override
    public int getItemCount() {
        return Math.max(lotngIngoList.size(), 0);
    }

    public static class ViewHolder extends RecyclerView.ViewHolder{
        private TextView tv_lotinfoList;
        private FreeUI_ClearEditText et_reason;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            tv_lotinfoList = itemView.findViewById(R.id.tv_lotinfoList);
            et_reason = itemView.findViewById(R.id.et_reason);
        }
    }
}
